package org.example.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.model.common.Response;
import org.example.mapper.SimProjectMapper;
import org.example.model.SimProject;
import org.example.model.common.SimProjectQry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @Author: Ran
 * @Date: 2021/9/14
 **/
@Service
public class ProjectService {

    @Autowired
    private SimProjectMapper simProjectMapper;

    /**
     * 查询Project 列表
     *
     * @param simProjectQry
     * @return Response
     */
    public Response getProjectList(SimProjectQry simProjectQry) {
        PageHelper.startPage(simProjectQry.getPageNum(), simProjectQry.getPageSize());
        PageInfo<SimProject> pageInfo = new PageInfo<>(simProjectMapper.getProjectList(simProjectQry));
        return Response.buildSuccess(pageInfo);
    }
}
